<!-- 设备用户关联表详情弹窗 -->
<template>
  <a-form
    ref="form3"
    class="ele-form-detail"
    :model="deviceCatUserModalApp.deviceCatUser"
    :label-col="{md: {span: 2}, sm: {span: 4}, xs: {span: 6}}"
    :wrapper-col="{md: {span: 22}, sm: {span: 20}, xs: {span: 18}}">
    <a-descriptions :title="deviceCatUserModalApp.title" bordered>
<!--      <a-descriptions-item label="标识">-->
<!--        {{ deviceCatUserModalApp.deviceCatUser.Eid }}-->
<!--      </a-descriptions-item>-->
<!--      <a-descriptions-item label="创建人">-->
<!--        {{ deviceCatUserModalApp.deviceCatUser.creatorName }}-->
<!--      </a-descriptions-item>-->
<!--      <a-descriptions-item label="名称">-->
<!--        {{ deviceCatUserModalApp.deviceCatUser.name }}-->
<!--      </a-descriptions-item>-->
      <a-descriptions-item label="设备">
        {{ deviceCatUserModalApp.deviceCatUser.deviceId }}
      </a-descriptions-item>
      <a-descriptions-item label="用户">
        {{ deviceCatUserModalApp.deviceCatUser.userId }}
      </a-descriptions-item>
      <a-descriptions-item label="管理过期时间">
        {{ deviceCatUserModalApp.deviceCatUser.expirationDate }}
      </a-descriptions-item>
      <a-descriptions-item label="状态">
        {{ deviceCatUserModalApp.deviceCatUser.status }}
      </a-descriptions-item>
<!--      <a-descriptions-item label="创建人ID">-->
<!--        {{ deviceCatUserModalApp.deviceCatUser.creatorId }}-->
<!--      </a-descriptions-item>-->
      <a-descriptions-item label="备注">
        {{ deviceCatUserModalApp.deviceCatUser.remark }}
      </a-descriptions-item>
      <a-descriptions-item label="创建时间">
        {{ deviceCatUserModalApp.deviceCatUser.createDatetime }}
      </a-descriptions-item>
    </a-descriptions>
  </a-form>
</template>

<script>
import {defineComponent, reactive, onMounted, inject} from "vue";
import {useRoute} from "vue-router"
import {DeviceCatUserService} from "@/views/repair/repairManagement/deviceCatUser/deviceCatUserService";

export default defineComponent({
  setup() {
    const route = useRoute();
    let routeId = route.params.id;
    let deviceCatUserListApp = inject('deviceCatUserListApp', reactive({}));
    const deviceCatUserModalApp = reactive({id: null, deviceCatUser: {}, display: false});

    onMounted(() => {
      deviceCatUserModalApp.deviceCatUser = {};
      if (routeId) {
        deviceCatUserModalApp.id = routeId;
      } else if (deviceCatUserListApp.viewModalShowing) {
        deviceCatUserModalApp.id = deviceCatUserListApp.currentId;
        deviceCatUserModalApp.display = true;
      }
      if (deviceCatUserModalApp.id) {
        getInfo(deviceCatUserModalApp.id);
      }
    })

    const getInfo = (id) => {
      DeviceCatUserService.findDeviceCatUser(id).then((res) => {
        deviceCatUserModalApp.deviceCatUser = res.data;
        deviceCatUserModalApp.title = "查看 " + deviceCatUserModalApp.deviceCatUser.name;
      })
    }

    return {
      deviceCatUserModalApp,
      routeId,
      getInfo,
    }
  }
})
</script>

<style scoped>
</style>

